package com.fulihui.information.api;

import com.fulihui.information.dto.CategoryDTO;
import com.fulihui.information.request.CategoryCodeRequest;
import com.fulihui.information.request.CategoryQueryRequest;
import com.fulihui.information.request.CategorySaveRequest;
import com.fulihui.information.request.CategoryTransformSequenceRequest;
import org.near.servicesupport.result.BaseResult;
import org.near.servicesupport.result.TMultiResult;
import org.near.servicesupport.result.TSingleResult;

/**
 * 类目服务
 * @author Willard.Hu on 2016/12/26 0026.
 */
public interface CategoryService {

    /**
     * 按 parentCode + productCode 查询一组类目，根类目parentCode不填写（有缓存）
     * @param request {@link CategoryQueryRequest}
     * @return {@link CategoryDTO} 列表
     */
    TMultiResult<CategoryDTO> queryGroup(CategoryQueryRequest request);

    /**
     * 按 parentCode + productCode 查询一组类目，根类目parentCode不填写（实时）
     * @param request {@link CategoryQueryRequest}
     * @return {@link CategoryDTO} 列表
     */
    TMultiResult<CategoryDTO> queryGroupRT(CategoryQueryRequest request);

    /**
     * 查询所有
     * @return {@link CategoryDTO} 列表
     */
    TMultiResult<CategoryDTO> query(CategoryQueryRequest request);

    /**
     * 保存修改类目
     * @param request {@link CategorySaveRequest}
     * @return {@link BaseResult}
     */
    BaseResult save(CategorySaveRequest request);

    /**
     * 交换两个类目的麦序
     * @param request {@link CategoryTransformSequenceRequest}
     * @return {@link BaseResult}
     */
    BaseResult transformSequence(CategoryTransformSequenceRequest request);

    /**
     * 类目代码查询单个类目
     * @param request {@link CategoryCodeRequest}
     * @return {@link CategoryDTO}
     */
    TSingleResult<CategoryDTO> querySingle(CategoryCodeRequest request);
}
